package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionCrowdMapper;
import com.ruoyi.net.domain.ElementQosActionCrowd;
import com.ruoyi.net.service.IElementQosActionCrowdService;

/**
 * 网元-QOS配置-流行为-拥塞策略Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionCrowdServiceImpl implements IElementQosActionCrowdService 
{
    @Autowired
    private ElementQosActionCrowdMapper elementQosActionCrowdMapper;

    /**
     * 查询网元-QOS配置-流行为-拥塞策略
     * 
     * @param id 网元-QOS配置-流行为-拥塞策略主键
     * @return 网元-QOS配置-流行为-拥塞策略
     */
    @Override
    public ElementQosActionCrowd selectElementQosActionCrowdById(String id)
    {
        return elementQosActionCrowdMapper.selectElementQosActionCrowdById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-拥塞策略列表
     * 
     * @param elementQosActionCrowd 网元-QOS配置-流行为-拥塞策略
     * @return 网元-QOS配置-流行为-拥塞策略
     */
    @Override
    public List<ElementQosActionCrowd> selectElementQosActionCrowdList(ElementQosActionCrowd elementQosActionCrowd)
    {
        return elementQosActionCrowdMapper.selectElementQosActionCrowdList(elementQosActionCrowd);
    }

    /**
     * 新增网元-QOS配置-流行为-拥塞策略
     * 
     * @param elementQosActionCrowd 网元-QOS配置-流行为-拥塞策略
     * @return 结果
     */
    @Override
    public int insertElementQosActionCrowd(ElementQosActionCrowd elementQosActionCrowd)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionCrowd.getId())) {
            elementQosActionCrowd.setId(uuid);
        }
        elementQosActionCrowd.setCreateBy(SecurityUtils.getUsername());
        elementQosActionCrowd.setCreateTime(DateUtils.getNowDate());
        elementQosActionCrowd.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionCrowd.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionCrowdMapper.insertElementQosActionCrowd(elementQosActionCrowd);
    }

    /**
     * 修改网元-QOS配置-流行为-拥塞策略
     * 
     * @param elementQosActionCrowd 网元-QOS配置-流行为-拥塞策略
     * @return 结果
     */
    @Override
    public int updateElementQosActionCrowd(ElementQosActionCrowd elementQosActionCrowd)
    {
        elementQosActionCrowd.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionCrowd.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionCrowdMapper.updateElementQosActionCrowd(elementQosActionCrowd);
    }

    /**
     * 批量删除网元-QOS配置-流行为-拥塞策略
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-拥塞策略主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionCrowdByIds(String[] ids)
    {
        return elementQosActionCrowdMapper.deleteElementQosActionCrowdByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-拥塞策略信息
     * 
     * @param id 网元-QOS配置-流行为-拥塞策略主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionCrowdById(String id)
    {
        return elementQosActionCrowdMapper.deleteElementQosActionCrowdById(id);
    }
}
